package main

import (
	"fmt"
	"sort"
)

//map存储是无序的,通过slice进行间接排序
func main() {
	m := map[int]string{1:"a", 2:"b", 3:"4"}
	s := make([]int, len(m))
	i := 0
	for k ,_ := range m{
		s[i] = k
		i++
	}
    sort.Ints(s)
	fmt.Println(s)
}